<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <a href="/user/add">添加</a>
    <table th:each="user:${users}">
        <tr>
            <td th:text="${user.name}"></td>
            <td th:text="${user.age}"></td>
            <td th:text="${user.idcardNo}"></td>
            <td>
                <a th:href="@{/user/delete?idcardNo=}+${user.idcardNo}" onclick="confirm123()">删除</a>
<!--      在创建a标签时就已经写好了          -->
            </td>
        </tr>
    </table>
</body>
<script>
    function confirm123(){
        return confirm('是否删除');
    }
</script>
</html>